﻿using System;
namespace Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister {
    
    
    [global::Xtee.Core.Attributes.XmlTypeAttribute(Name="pol_soiduk2", Namespace="http://producers.liiklusregister.xtee.riik.ee/producer/liiklusregister", Target=typeof(PolSoiduk2))]
    public class PolSoiduk2Serializer : global::Xtee.Core.Types.AbstractXteeSerializable {
        
        protected IPolSoiduk2 clazz;
        
        public PolSoiduk2Serializer(IPolSoiduk2 clazz) {
            this.clazz = clazz;
        }
        
        public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
            base.WriteXml(Writer);
            Writer.WriteStartElement("id");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Id))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("eelnev_id");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EelnevId))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("jargnev_id");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.JargnevId))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("regtun");
            if (clazz.Regtun!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Regtun))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Regtun");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("reg_mrk");
            if (clazz.RegMrk!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.RegMrk))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : RegMrk");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("registris");
            if (clazz.Registris!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Registris))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Registris");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("eestis");
            if (clazz.Eestis!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Eestis))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Eestis");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("vinkood");
            if (clazz.Vinkood!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Vinkood))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Vinkood");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("kateg");
            if (clazz.Kateg!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Kateg))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Kateg");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("mark");
            if (clazz.Mark!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Mark))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Mark");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("mudel");
            if (clazz.Mudel!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Mudel))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Mudel");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("aasta");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Aasta))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("varvus");
            if (clazz.Varvus!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Varvus))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Varvus");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("kerenm");
            if (clazz.Kerenm!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Kerenm))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Kerenm");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("tyypkd");
            if (clazz.Tyypkd!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Tyypkd))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Tyypkd");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("mootmht");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Mootmht))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("mootvms");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Mootvms))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("mootornm");
            if (clazz.Mootornm!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Mootornm))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Mootornm");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("kaigkastyp");
            if (clazz.Kaigkastyp!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Kaigkastyp))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Kaigkastyp");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("taismass");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Taismass))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("regmass");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Regmass))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("tyhimass");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Tyhimass))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("istekohti");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Istekohti))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("seisukohti");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Seisukohti))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("kandevoime");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Kandevoime))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("pikkus");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Pikkus))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("laius");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Laius))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("korgus");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Korgus))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("telgarv");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Telgarv))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("telgveo");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Telgveo))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("uksi");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Uksi))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("telgjuht");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Telgjuht))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("teljekoormused");
            if (clazz.Teljekoormused!=null) {
                global::Xtee.Core.SerializationMetadata metaTeljekoormused = this.GetMetaData(clazz.Teljekoormused);
                Writer.WriteTypeAttribute(metaTeljekoormused.TypeQualifiedName.Namespace, metaTeljekoormused.TypeQualifiedName.Name);
                metaTeljekoormused.NewSerializer(clazz.Teljekoormused).WriteXml(Writer);
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Teljekoormused");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("haagis_piduritega");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.HaagisPiduritega))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("haagis_piduriteta");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.HaagisPiduriteta))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("byroo");
            if (clazz.Byroo!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Byroo))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Byroo");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("reg_tunnistuse_kp");
            if (clazz.RegTunnistuseKp!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.RegTunnistuseKp))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : RegTunnistuseKp");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("reg_tun_keht");
            if (clazz.RegTunKeht!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.RegTunKeht))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : RegTunKeht");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("markused");
            if (clazz.Markused!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Markused))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Markused");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("piirang");
            if (clazz.Piirang!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Piirang))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Piirang");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("olek");
            if (clazz.Olek!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Olek))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Olek");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("oleku_kp");
            if (clazz.OlekuKp!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.OlekuKp))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : OlekuKp");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("registri_olek");
            if (clazz.RegistriOlek!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.RegistriOlek))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : RegistriOlek");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("liiklusesse_lubatud");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "boolean");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdBoolean(((bool)(clazz.LiiklusesseLubatud))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("ylevaatused");
            if (clazz.Ylevaatused!=null) {
                global::Xtee.Core.SerializationMetadata metaYlevaatused = this.GetMetaData(clazz.Ylevaatused);
                Writer.WriteTypeAttribute(metaYlevaatused.TypeQualifiedName.Namespace, metaYlevaatused.TypeQualifiedName.Name);
                metaYlevaatused.NewSerializer(clazz.Ylevaatused).WriteXml(Writer);
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Ylevaatused");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("isikud");
            if (clazz.Isikud!=null) {
                global::Xtee.Core.SerializationMetadata metaIsikud = this.GetMetaData(clazz.Isikud);
                Writer.WriteTypeAttribute(metaIsikud.TypeQualifiedName.Namespace, metaIsikud.TypeQualifiedName.Name);
                metaIsikud.NewSerializer(clazz.Isikud).WriteXml(Writer);
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Isikud");
            }
            Writer.WriteEndElement();
        }
        
        public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
            base.ReadXml(Reader);
        START:
            if ((Reader.LocalName == "id")) {
                goto id;
            }
            else {
                if ((Reader.LocalName == "eelnev_id")) {
                    goto eelnev_id;
                }
                else {
                    if ((Reader.LocalName == "jargnev_id")) {
                        goto jargnev_id;
                    }
                    else {
                        if ((Reader.LocalName == "regtun")) {
                            goto regtun;
                        }
                        else {
                            if ((Reader.LocalName == "reg_mrk")) {
                                goto reg_mrk;
                            }
                            else {
                                if ((Reader.LocalName == "registris")) {
                                    goto registris;
                                }
                                else {
                                    if ((Reader.LocalName == "eestis")) {
                                        goto eestis;
                                    }
                                    else {
                                        if ((Reader.LocalName == "vinkood")) {
                                            goto vinkood;
                                        }
                                        else {
                                            if ((Reader.LocalName == "kateg")) {
                                                goto kateg;
                                            }
                                            else {
                                                if ((Reader.LocalName == "mark")) {
                                                    goto mark;
                                                }
                                                else {
                                                    if ((Reader.LocalName == "mudel")) {
                                                        goto mudel;
                                                    }
                                                    else {
                                                        if ((Reader.LocalName == "aasta")) {
                                                            goto aasta;
                                                        }
                                                        else {
                                                            if ((Reader.LocalName == "varvus")) {
                                                                goto varvus;
                                                            }
                                                            else {
                                                                if ((Reader.LocalName == "kerenm")) {
                                                                    goto kerenm;
                                                                }
                                                                else {
                                                                    if ((Reader.LocalName == "tyypkd")) {
                                                                        goto tyypkd;
                                                                    }
                                                                    else {
                                                                        if ((Reader.LocalName == "mootmht")) {
                                                                            goto mootmht;
                                                                        }
                                                                        else {
                                                                            if ((Reader.LocalName == "mootvms")) {
                                                                                goto mootvms;
                                                                            }
                                                                            else {
                                                                                if ((Reader.LocalName == "mootornm")) {
                                                                                    goto mootornm;
                                                                                }
                                                                                else {
                                                                                    if ((Reader.LocalName == "kaigkastyp")) {
                                                                                        goto kaigkastyp;
                                                                                    }
                                                                                    else {
                                                                                        if ((Reader.LocalName == "taismass")) {
                                                                                            goto taismass;
                                                                                        }
                                                                                        else {
                                                                                            if ((Reader.LocalName == "regmass")) {
                                                                                                goto regmass;
                                                                                            }
                                                                                            else {
                                                                                                if ((Reader.LocalName == "tyhimass")) {
                                                                                                    goto tyhimass;
                                                                                                }
                                                                                                else {
                                                                                                    if ((Reader.LocalName == "istekohti")) {
                                                                                                        goto istekohti;
                                                                                                    }
                                                                                                    else {
                                                                                                        if ((Reader.LocalName == "seisukohti")) {
                                                                                                            goto seisukohti;
                                                                                                        }
                                                                                                        else {
                                                                                                            if ((Reader.LocalName == "kandevoime")) {
                                                                                                                goto kandevoime;
                                                                                                            }
                                                                                                            else {
                                                                                                                if ((Reader.LocalName == "pikkus")) {
                                                                                                                    goto pikkus;
                                                                                                                }
                                                                                                                else {
                                                                                                                    if ((Reader.LocalName == "laius")) {
                                                                                                                        goto laius;
                                                                                                                    }
                                                                                                                    else {
                                                                                                                        if ((Reader.LocalName == "korgus")) {
                                                                                                                            goto korgus;
                                                                                                                        }
                                                                                                                        else {
                                                                                                                            if ((Reader.LocalName == "telgarv")) {
                                                                                                                                goto telgarv;
                                                                                                                            }
                                                                                                                            else {
                                                                                                                                if ((Reader.LocalName == "telgveo")) {
                                                                                                                                    goto telgveo;
                                                                                                                                }
                                                                                                                                else {
                                                                                                                                    if ((Reader.LocalName == "uksi")) {
                                                                                                                                        goto uksi;
                                                                                                                                    }
                                                                                                                                    else {
                                                                                                                                        if ((Reader.LocalName == "telgjuht")) {
                                                                                                                                            goto telgjuht;
                                                                                                                                        }
                                                                                                                                        else {
                                                                                                                                            if ((Reader.LocalName == "teljekoormused")) {
                                                                                                                                                goto teljekoormused;
                                                                                                                                            }
                                                                                                                                            else {
                                                                                                                                                if ((Reader.LocalName == "haagis_piduritega")) {
                                                                                                                                                    goto haagis_piduritega;
                                                                                                                                                }
                                                                                                                                                else {
                                                                                                                                                    if ((Reader.LocalName == "haagis_piduriteta")) {
                                                                                                                                                        goto haagis_piduriteta;
                                                                                                                                                    }
                                                                                                                                                    else {
                                                                                                                                                        if ((Reader.LocalName == "byroo")) {
                                                                                                                                                            goto byroo;
                                                                                                                                                        }
                                                                                                                                                        else {
                                                                                                                                                            if ((Reader.LocalName == "reg_tunnistuse_kp")) {
                                                                                                                                                                goto reg_tunnistuse_kp;
                                                                                                                                                            }
                                                                                                                                                            else {
                                                                                                                                                                if ((Reader.LocalName == "reg_tun_keht")) {
                                                                                                                                                                    goto reg_tun_keht;
                                                                                                                                                                }
                                                                                                                                                                else {
                                                                                                                                                                    if ((Reader.LocalName == "markused")) {
                                                                                                                                                                        goto markused;
                                                                                                                                                                    }
                                                                                                                                                                    else {
                                                                                                                                                                        if ((Reader.LocalName == "piirang")) {
                                                                                                                                                                            goto piirang;
                                                                                                                                                                        }
                                                                                                                                                                        else {
                                                                                                                                                                            if ((Reader.LocalName == "olek")) {
                                                                                                                                                                                goto olek;
                                                                                                                                                                            }
                                                                                                                                                                            else {
                                                                                                                                                                                if ((Reader.LocalName == "oleku_kp")) {
                                                                                                                                                                                    goto oleku_kp;
                                                                                                                                                                                }
                                                                                                                                                                                else {
                                                                                                                                                                                    if ((Reader.LocalName == "registri_olek")) {
                                                                                                                                                                                        goto registri_olek;
                                                                                                                                                                                    }
                                                                                                                                                                                    else {
                                                                                                                                                                                        if ((Reader.LocalName == "liiklusesse_lubatud")) {
                                                                                                                                                                                            goto liiklusesse_lubatud;
                                                                                                                                                                                        }
                                                                                                                                                                                        else {
                                                                                                                                                                                            if ((Reader.LocalName == "ylevaatused")) {
                                                                                                                                                                                                goto ylevaatused;
                                                                                                                                                                                            }
                                                                                                                                                                                            else {
                                                                                                                                                                                                if ((Reader.LocalName == "isikud")) {
                                                                                                                                                                                                    goto isikud;
                                                                                                                                                                                                }
                                                                                                                                                                                                else {
                                                                                                                                                                                                    return;
                                                                                                                                                                                                }
                                                                                                                                                                                            }
                                                                                                                                                                                        }
                                                                                                                                                                                    }
                                                                                                                                                                                }
                                                                                                                                                                            }
                                                                                                                                                                        }
                                                                                                                                                                    }
                                                                                                                                                                }
                                                                                                                                                            }
                                                                                                                                                        }
                                                                                                                                                    }
                                                                                                                                                }
                                                                                                                                            }
                                                                                                                                        }
                                                                                                                                    }
                                                                                                                                }
                                                                                                                            }
                                                                                                                        }
                                                                                                                    }
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        id:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>id");
            }
            clazz.Id = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("id")).Value;
            goto START;
        eelnev_id:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>eelnev_id");
            }
            clazz.EelnevId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("eelnev_id")).Value;
            goto START;
        jargnev_id:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>jargnev_id");
            }
            clazz.JargnevId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("jargnev_id")).Value;
            goto START;
        regtun:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>regtun");
            }
            clazz.Regtun = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("regtun")).Value;
            goto START;
        reg_mrk:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>reg_mrk");
            }
            clazz.RegMrk = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("reg_mrk")).Value;
            goto START;
        registris:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>registris");
            }
            clazz.Registris = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("registris")).Value;
            goto START;
        eestis:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>eestis");
            }
            clazz.Eestis = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("eestis")).Value;
            goto START;
        vinkood:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>vinkood");
            }
            clazz.Vinkood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vinkood")).Value;
            goto START;
        kateg:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>kateg");
            }
            clazz.Kateg = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kateg")).Value;
            goto START;
        mark:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>mark");
            }
            clazz.Mark = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("mark")).Value;
            goto START;
        mudel:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>mudel");
            }
            clazz.Mudel = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("mudel")).Value;
            goto START;
        aasta:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>aasta");
            }
            clazz.Aasta = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("aasta")).Value;
            goto START;
        varvus:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>varvus");
            }
            clazz.Varvus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("varvus")).Value;
            goto START;
        kerenm:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>kerenm");
            }
            clazz.Kerenm = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kerenm")).Value;
            goto START;
        tyypkd:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>tyypkd");
            }
            clazz.Tyypkd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("tyypkd")).Value;
            goto START;
        mootmht:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>mootmht");
            }
            clazz.Mootmht = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("mootmht")).Value;
            goto START;
        mootvms:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>mootvms");
            }
            clazz.Mootvms = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("mootvms")).Value;
            goto START;
        mootornm:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>mootornm");
            }
            clazz.Mootornm = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("mootornm")).Value;
            goto START;
        kaigkastyp:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>kaigkastyp");
            }
            clazz.Kaigkastyp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kaigkastyp")).Value;
            goto START;
        taismass:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>taismass");
            }
            clazz.Taismass = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("taismass")).Value;
            goto START;
        regmass:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>regmass");
            }
            clazz.Regmass = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("regmass")).Value;
            goto START;
        tyhimass:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>tyhimass");
            }
            clazz.Tyhimass = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("tyhimass")).Value;
            goto START;
        istekohti:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>istekohti");
            }
            clazz.Istekohti = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("istekohti")).Value;
            goto START;
        seisukohti:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>seisukohti");
            }
            clazz.Seisukohti = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("seisukohti")).Value;
            goto START;
        kandevoime:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>kandevoime");
            }
            clazz.Kandevoime = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("kandevoime")).Value;
            goto START;
        pikkus:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>pikkus");
            }
            clazz.Pikkus = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("pikkus")).Value;
            goto START;
        laius:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>laius");
            }
            clazz.Laius = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("laius")).Value;
            goto START;
        korgus:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>korgus");
            }
            clazz.Korgus = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("korgus")).Value;
            goto START;
        telgarv:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>telgarv");
            }
            clazz.Telgarv = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("telgarv")).Value;
            goto START;
        telgveo:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>telgveo");
            }
            clazz.Telgveo = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("telgveo")).Value;
            goto START;
        uksi:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>uksi");
            }
            clazz.Uksi = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("uksi")).Value;
            goto START;
        telgjuht:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>telgjuht");
            }
            clazz.Telgjuht = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("telgjuht")).Value;
            goto START;
        teljekoormused:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>teljekoormused");
            }
            global::Xtee.Core.SerializationMetadata metaTeljekoormused = this.GetMetaData<PolSoiduk2.ITeljekoormusedType>(Reader, ">>pol_soiduk2>teljekoormused", "http://producers.liiklusregister.xtee.riik.ee/producer/liiklusregister");
            clazz.Teljekoormused = metaTeljekoormused.NewEntity<PolSoiduk2.ITeljekoormusedType>();
            if ((Reader.IsEmptyElement == false)) {
                Reader.ReadStartElement("teljekoormused");
                metaTeljekoormused.NewSerializer(clazz.Teljekoormused).ReadXml(Reader);
                Reader.ReadEndElement();
            }
            else {
                Reader.Skip();
            }
            goto START;
        haagis_piduritega:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>haagis_piduritega");
            }
            clazz.HaagisPiduritega = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("haagis_piduritega")).Value;
            goto START;
        haagis_piduriteta:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>haagis_piduriteta");
            }
            clazz.HaagisPiduriteta = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("haagis_piduriteta")).Value;
            goto START;
        byroo:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>byroo");
            }
            clazz.Byroo = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("byroo")).Value;
            goto START;
        reg_tunnistuse_kp:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>reg_tunnistuse_kp");
            }
            clazz.RegTunnistuseKp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("reg_tunnistuse_kp")).Value;
            goto START;
        reg_tun_keht:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>reg_tun_keht");
            }
            clazz.RegTunKeht = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("reg_tun_keht")).Value;
            goto START;
        markused:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>markused");
            }
            clazz.Markused = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("markused")).Value;
            goto START;
        piirang:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>piirang");
            }
            clazz.Piirang = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("piirang")).Value;
            goto START;
        olek:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>olek");
            }
            clazz.Olek = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("olek")).Value;
            goto START;
        oleku_kp:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>oleku_kp");
            }
            clazz.OlekuKp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("oleku_kp")).Value;
            goto START;
        registri_olek:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>registri_olek");
            }
            clazz.RegistriOlek = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("registri_olek")).Value;
            goto START;
        liiklusesse_lubatud:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>liiklusesse_lubatud");
            }
            clazz.LiiklusesseLubatud = new global::Xtee.Core.Schema.XsdBoolean(Reader.ReadElementString("liiklusesse_lubatud")).Value;
            goto START;
        ylevaatused:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>ylevaatused");
            }
            global::Xtee.Core.SerializationMetadata metaYlevaatused = this.GetMetaData<PolSoiduk2.IYlevaatusedType>(Reader, ">>pol_soiduk2>ylevaatused", "http://producers.liiklusregister.xtee.riik.ee/producer/liiklusregister");
            clazz.Ylevaatused = metaYlevaatused.NewEntity<PolSoiduk2.IYlevaatusedType>();
            if ((Reader.IsEmptyElement == false)) {
                Reader.ReadStartElement("ylevaatused");
                metaYlevaatused.NewSerializer(clazz.Ylevaatused).ReadXml(Reader);
                Reader.ReadEndElement();
            }
            else {
                Reader.Skip();
            }
            goto START;
        isikud:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>pol_soiduk2>isikud");
            }
            global::Xtee.Core.SerializationMetadata metaIsikud = this.GetMetaData<PolSoiduk2.IIsikudType>(Reader, ">>pol_soiduk2>isikud", "http://producers.liiklusregister.xtee.riik.ee/producer/liiklusregister");
            clazz.Isikud = metaIsikud.NewEntity<PolSoiduk2.IIsikudType>();
            if ((Reader.IsEmptyElement == false)) {
                Reader.ReadStartElement("isikud");
                metaIsikud.NewSerializer(clazz.Isikud).ReadXml(Reader);
                Reader.ReadEndElement();
            }
            else {
                Reader.Skip();
            }
            goto START;
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>pol_soiduk2>teljekoormused", Namespace="http://producers.liiklusregister.xtee.riik.ee/producer/liiklusregister", Target=typeof(PolSoiduk2.TeljekoormusedType))]
        public class TeljekoormusedTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected PolSoiduk2.ITeljekoormusedType clazz;
            
            public TeljekoormusedTypeSerializer(PolSoiduk2.ITeljekoormusedType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                for (int x = 0; ((clazz.Teljekoormus != null) 
                            && (x < clazz.Teljekoormus.Count)); x = (x + 1)) {
                    if (clazz.Teljekoormus[x]!=null) {
                        Writer.WriteStartElement("teljekoormus");
                        global::Xtee.Core.SerializationMetadata metaTeljekoormus = this.GetMetaData(clazz.Teljekoormus[x]);
                        Writer.WriteTypeAttribute(metaTeljekoormus.TypeQualifiedName.Namespace, metaTeljekoormus.TypeQualifiedName.Name);
                        metaTeljekoormus.NewSerializer(clazz.Teljekoormus[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="teljekoormus") {
                    clazz.Teljekoormus = new System.Collections.Generic.List<global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.ITeljekoormus>();
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "teljekoormus")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>pol_soiduk2>teljekoormused>teljekoormus");
                        }
                        global::Xtee.Core.SerializationMetadata metaTeljekoormus = this.GetMetaData<global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.ITeljekoormus>(Reader, "teljekoormus", "http://producers.liiklusregister.xtee.riik.ee/producer/liiklusregister");
                        global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.ITeljekoormus item = metaTeljekoormus.NewEntity<global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.ITeljekoormus>();
                        clazz.Teljekoormus.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("teljekoormus");
                            metaTeljekoormus.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>pol_soiduk2>ylevaatused", Namespace="http://producers.liiklusregister.xtee.riik.ee/producer/liiklusregister", Target=typeof(PolSoiduk2.YlevaatusedType))]
        public class YlevaatusedTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected PolSoiduk2.IYlevaatusedType clazz;
            
            public YlevaatusedTypeSerializer(PolSoiduk2.IYlevaatusedType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                for (int x = 0; ((clazz.Ylevaatus != null) 
                            && (x < clazz.Ylevaatus.Count)); x = (x + 1)) {
                    if (clazz.Ylevaatus[x]!=null) {
                        Writer.WriteStartElement("ylevaatus");
                        global::Xtee.Core.SerializationMetadata metaYlevaatus = this.GetMetaData(clazz.Ylevaatus[x]);
                        Writer.WriteTypeAttribute(metaYlevaatus.TypeQualifiedName.Namespace, metaYlevaatus.TypeQualifiedName.Name);
                        metaYlevaatus.NewSerializer(clazz.Ylevaatus[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="ylevaatus") {
                    clazz.Ylevaatus = new System.Collections.Generic.List<global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.IYlevaatus>();
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "ylevaatus")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>pol_soiduk2>ylevaatused>ylevaatus");
                        }
                        global::Xtee.Core.SerializationMetadata metaYlevaatus = this.GetMetaData<global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.IYlevaatus>(Reader, "ylevaatus", "http://producers.liiklusregister.xtee.riik.ee/producer/liiklusregister");
                        global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.IYlevaatus item = metaYlevaatus.NewEntity<global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.IYlevaatus>();
                        clazz.Ylevaatus.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("ylevaatus");
                            metaYlevaatus.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>pol_soiduk2>isikud", Namespace="http://producers.liiklusregister.xtee.riik.ee/producer/liiklusregister", Target=typeof(PolSoiduk2.IsikudType))]
        public class IsikudTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected PolSoiduk2.IIsikudType clazz;
            
            public IsikudTypeSerializer(PolSoiduk2.IIsikudType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                for (int x = 0; ((clazz.Isik != null) 
                            && (x < clazz.Isik.Count)); x = (x + 1)) {
                    if (clazz.Isik[x]!=null) {
                        Writer.WriteStartElement("isik");
                        global::Xtee.Core.SerializationMetadata metaIsik = this.GetMetaData(clazz.Isik[x]);
                        Writer.WriteTypeAttribute(metaIsik.TypeQualifiedName.Namespace, metaIsik.TypeQualifiedName.Name);
                        metaIsik.NewSerializer(clazz.Isik[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="isik") {
                    clazz.Isik = new System.Collections.Generic.List<global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.IPolSoiduk2Isik>();
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "isik")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>pol_soiduk2>isikud>isik");
                        }
                        global::Xtee.Core.SerializationMetadata metaIsik = this.GetMetaData<global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.IPolSoiduk2Isik>(Reader, "pol_soiduk2_isik", "http://producers.liiklusregister.xtee.riik.ee/producer/liiklusregister");
                        global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.IPolSoiduk2Isik item = metaIsik.NewEntity<global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.IPolSoiduk2Isik>();
                        clazz.Isik.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("isik");
                            metaIsik.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                }
            }
        }
    }
}
